<!DOCTYPE html>
<html lang="en" ng-app="test">
<head>
	<meta charset="UTF-8">
	<title>Document</title>
</head>
<body ng-controller="main">
<!-- 过滤器：把数字转换成货币形式 -->
	<!-- <div>{{aa|currency:"￥"}}</div> -->
	<!-- 把所有大写转换成小写  -->
	<!-- <div>{{bb|lowercase}}</div> -->

	<ul>
		<li ng-repeat="p in person | sexFilter:'sex'">{{p}}</li>
	</ul>
	
</body>
<script type="text/javascript" src="angular.min.js"></script>
<script type="text/javascript">
	var app = angular.module("test",["guolv"]);
	app.controller("main",function($scope) {
		// $scope.aa = 11100000;
		// $scope.bb = "ASDASDFASFFD";
		$scope.person = [{name:"one",sex:"女"},{name:"two",sex:"女"},{name:"three",sex:"男"},{name:"four",sex:"男"},{name:"five",sex:"女"}]
	})
	//自定义过滤器
	var filters = angular.module("guolv",[]);
	filters.filter("sexFilter",function(){
		return function(data,property){
		var sports = [];
		if(angular.isArray(data)){
			for(var i = 0;i < data.length;i++){
				if(sports.indexOf(data[i][property]) == -1){
					sports.push(data[i][property]);
				}
			}
			return sports;
		}else{
			return [];
		}
	}
	});
</script>
</html>